<?php
namespace app\http\middleware;
use Behavior\LoginBehavior;
use Service\JsonService;
use think\Request;
class Check
{
    public function handle($request, \Closure $next)
    {
        var_dump($request->param('name'));
        if (!LoginBehavior::isLogin()) {
            if ($request->isAjax()) {
                
                return JsonService::errorResponse("请登录后进行操作");
            }else{
                return redirect('/NOlogin'); 
            }   
        }
        
        return $next($request);
    }
}
